%%% -------------------------------------------------------------------
%%% Author  : vjache
%%% Description :
%%%
%%% Created : Dec 26, 2009
%%% -------------------------------------------------------------------
-module(beta_memory).

%% --------------------------------------------------------------------
%% Include files
%% --------------------------------------------------------------------
-include("../../include/erete.hrl").
%% --------------------------------------------------------------------
%% API exports
%% --------------------------------------------------------------------
-export([insert/4,fetch_values/3,delete/4]).

%% --------------------------------------------------------------------
%% API Functions
%% --------------------------------------------------------------------

%% --------------------------------------------------------------------
%% Function: insert(MH,Mp,K,V) -> true | false
%% Description: Inserts entry for the specified	mapper Mp. K and V is 
%%				an entry.
%% Returns: 'true' if such an entry not existed and 'false' otherwise.
%% --------------------------------------------------------------------
insert(#mh{module=M,handle=H},Mp,K,V) ->
	M:insert(H,Mp,K,V).

%% --------------------------------------------------------------------
%% Function: fetch_values(MH,Mp,K) -> iter()
%% Description: Fetches all values corresponding to the specified 
%%				mapper Mp and key K.
%% Returns: Iterator. See iter.erl.
%% --------------------------------------------------------------------
fetch_values(#mh{module=M,handle=H},Mp,K) ->
	M:fetch_values(H,Mp,K).

%% --------------------------------------------------------------------
%% Function: delete(MH,Mp,K,V) -> true | false
%% Description: Deletes entry for the specified	mapper Mp. K and V is 
%%				an entry.
%% Returns: 'true' if such an entry existed and 'false' otherwise.
%% --------------------------------------------------------------------
delete(#mh{module=M,handle=H},Mp,K,V) ->
	M:delete(H,Mp,K,V).

%%
%% Local Functions
%%

